package com.imooc.sell.utils;

import com.imooc.sell.VO.ResultVo;

public class ResultVoUtil {

  /**
   * 返回结果没问题
   */
  public static ResultVo success(Object object) {
    ResultVo resultVo = new ResultVo();
    resultVo.setCode(200);
    resultVo.setMsg("成功");
    resultVo.setData(object);
    return resultVo;
  }

  /**
   * 成功什么结果也没有
   */

  public static ResultVo success() {
    return success(null);
  }

  /**
   * 返回失败的方法
   */
  public static ResultVo error(Integer code, String msg) {
    ResultVo resultVo = new ResultVo();
    resultVo.setCode(code);
    resultVo.setMsg(msg);
    return resultVo;
  }

}
